package polymorphism;

public class Test {

    public static void main(String[] args) {
//        fun(new Animal());
//        fun(new Bird());
//        fun(new Duck());
//        fun(new Dog());
        Animal animal=new Animal();
        Animal animal1=new Bird();
        Animal animal2=new Duck();
        Animal animal3=new Dog();
        fun(animal);
        fun(animal1);
        fun(animal2);
        fun(animal3);
    }

    public static void fun(Animal animal){
      animal.eat();
    }

    public static Animal ret(){
        Bird bird=new Bird();
        return bird;
    }


}
